﻿@model Sample.Web.Models.ModelSupplierIndex
@{   
	Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript">

	function addSupplier() {
		window.top.openDialog({ url: "/Supplier/Create/?pageState=" + create, title: "新增供应商信息", width: 600, height: 570 });
	}

	function editSupplier(id) {
		window.top.openDialog({ url: "/Supplier/Create/"+id+"/?pageState=" + edit, title: "编辑供应商信息", width: 600, height: 570 });
	}

	function show(id) {
		window.top.openDialog({ url: "/Supplier/Create/" + id + "?pageState=" + detail, title: "查看供应商信息", width: 600, height: 570 });
	}

</script>
<div>
	@using (Html.BeginForm())
 {
	 /* 工具栏
	 ----------------------------------------------------------*/
		<div class="toolbar">
			<div class="toolbar-left">
				@Html.Button(ButtonType.新增, "addSupplier()")
				@Html.Button(ButtonType.删除, "deleteSupplierBatch()")
				@Html.Button(ButtonType.条件查询, "commonPage.scan()")
			</div>
			<div class="toolbar-right">
				@Html.TextBoxFor(x => x.SearchEntity._CommonSearchCondition, new { @class = "common-search-condition" })
				<input type="submit" class="common-search-submit" value="" />
			</div>
		</div>
	 
	 /* 多条件查询
     ----------------------------------------------------------*/
		<div class="search-container">
			<table>
				<tr>
					<th>
						供应商名称：
					</th>
					<td>@Html.TextBoxFor(x => x.SearchEntity._SupplierName, new { style = "width:150px" })
					</td>
					<th>
						供货内容：
					</th>
					<td>@Html.TextBoxFor(x => x.SearchEntity._SupplyContent, new { style = "width:200px" })
					</td>
					<th>
						联系人：
					</th>
					<td>@Html.TextBoxFor(x => x.SearchEntity._ContactName, new { style = "width:100px" })
					</td>
					<td class="search-button">
						<input type="submit" value="" class="button-search" />
						<input type="button" value="" class="button-clear" />
					</td>
				</tr>
			</table>
		</div>
     
	 /* 说明文字
     ----------------------------------------------------------*/
		<div class="search-clue">
			您可通过该功能维护供应商的相关信息！
		</div>
	 /* 表格数据显示
      ----------------------------------------------------------*/
		<div class="common-table-container">
			<table class="common-table" id="common-table">
				<colgroup>
					<col width="50" />
					<col width="50" />
					<col width="200" />
					<col width="200" />
					<col width="80" />
					<col width="80" />
					<col width="80" />
					<col width="150" />
					<col width="80" />
					<col width="250" />
				</colgroup>
				<thead>
					<tr>
						<th>
							<input type="checkbox" class="common-table-checkbox-all" />
						</th>
						<th>
							操作
						</th>
						@Html.HiddenFor(x => x.SearchEntity._OrderName, new { data_order_name = "" })
						@Html.HiddenFor(x => x.SearchEntity._OrderDirection, new { data_order_direction = "" })
						@(Html.ThOrderHelper<UTSupplier>(x => x.SupplierName, "供应商名称"))
						@(Html.ThOrderHelper<UTSupplier>(x => x.SupplyContent, "供货内容"))
						@(Html.ThOrderHelper<UTSupplier>(x => x.ContactName, "联系人"))
						@(Html.ThOrderHelper<UTSupplier>(x => x.Mobile, "移动电话"))
						@(Html.ThOrderHelper<UTSupplier>(x => x.Telephone, "固定电话"))
						@(Html.ThOrderHelper<UTSupplier>(x => x.Email, "电子邮箱"))
						@(Html.ThOrderHelper<UTSupplier>(x => x.Fax, "传真"))
						@(Html.ThOrderHelper<UTSupplier>(x => x.Address, "地址"))
					</tr>
				</thead>
				<tbody>
					@foreach (var item in Model.GridDataSources)
	 {
						<tr ondblclick="javascript:show('@item.ID');">
							<td>
								<input type="checkbox" name="checkboxItem" class="checkboxItem" value="@item.ID" />
							</td>
							<td>
								<a href="javascript:editSupplier('@item.ID')" class="a-edit" title="修改">&nbsp</a>
							</td>
							<td>
								@(Project.Common.StringUtility.CutString(item.SupplierName, 14))
							</td>
							<td>
								@(Project.Common.StringUtility.CutString(item.SupplyContent, 14))
							</td>
							<td>
								@item.ContactName
							</td>
							<td>
								@item.Mobile
							</td>
							<td>
								@item.Telephone
							</td>
							<td>
								@item.Email
							</td>
							<td>
								@item.Fax
							</td>
							<td>
								@(Project.Common.StringUtility.CutString(item.Address, 14))
							</td>
						</tr>
	 }
				</tbody>
			</table>
		</div>
     
	 /* 分页显示
      ----------------------------------------------------------*/
		<div>
			@{
	 Html.RenderPartial("/Views/Controls/Paginate.cshtml", Model.PaginateHelperObject);
			}
		</div>
 }
</div>
